package com.csxh.bookstore.bean;

import java.io.Serializable;

public class Item implements Serializable{

	private Integer id;
	
	private String name;
	private Float  price;
	private int    count;
	
	//private Integer detailId;
	private OrderDetail detail;
	
	public void setDetail(OrderDetail detail) {
		this.detail = detail;
	}
	
	public OrderDetail getDetail() {
		return detail;
	}
	
	public void setDetailId(Integer detailId) {
		this.detail.setId(detailId);;
	}
	
	public Integer getDetailId() {
		return detail.getId();
	}
	
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Float getPrice() {
		return price;
	}
	public void setPrice(Float price) {
		this.price = price;
	}
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Item other = (Item) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	
	
	
}
